package com.huixue.zdb.util;

/**
 * 返回前端统一响应
 * 统一都有 状态码 消息 数据
 */
public class ResultBo {
    /** 状态码 */
    private Integer state=200;
    /** 消息 */
    private String msg;
    /** 数据 */
    private Object data;

    public ResultBo() {
    }

    public ResultBo(Integer state) {
        this.state = state;
    }

    public ResultBo(String msg) {
        this.msg = msg;
    }

    public ResultBo(String msg, Object data) {
        this.msg = msg;
        this.data = data;
    }

    public ResultBo(Integer state, String msg) {
        this.state = state;
        this.msg = msg;
    }

    public ResultBo(Integer state, String msg, Object data) {
        this.state = state;
        this.msg = msg;
        this.data = data;
    }
    public static ResultBo getInstance(){
        return new ResultBo();
    }



    public Integer getState() {
        return state;
    }

    public ResultBo setState(Integer state) {
        this.state = state;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public ResultBo setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getData() {
        return data;
    }

    public ResultBo setData(Object data) {
        this.data = data;
        return this;
    }
}
